﻿@{
    ViewBag.Title = "Resultado de busqueda";

    Layout = (ViewBag.esCliente!=null && ViewBag.esCliente?"~/Views/Shared/_ClienteLayout.cshtml":"~/Views/Shared/_Layout.cshtml");
}
@using equinoxWeb.Models;

<!-- content -->
<script src="/Scripts/caso.js"></script>

<fieldset style="width: inherit">
    <legend>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Documento de costos" : "Cost document")</legend>
</fieldset>
<table class="table table-hover">
    <tr>
        <th>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Caso":"Case")</th>
        <th>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Costo por hora": "Hourly rate")</th>
        <th>@(ViewBag.lang == null || ViewBag.lang == "ES" ? "Moneda" : "Currency")</th>
        <th>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Gastos":"Expenses")</th>
        <th>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Total de viajes":"Travelling ammount")</th>
        <th>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Total de trabajo":"Working ammount")</th>
    </tr>
    @foreach (Facturacion facturacion in ViewBag.listaFacturacion)
    {
        <tr>
            <td>@facturacion.ReferenciaCaso</td>
            <td>@facturacion.Rate</td>
            <td>@facturacion.Moneda</td>
            <td>@facturacion.Expenses</td>
            <td>@facturacion.TotalTravel</td>
            <td>@facturacion.TotalWork</td>

            <td><a href="/caso/CostDetails?idCaso=@facturacion.IdCaso&idFacturacion=@facturacion.IdFacturacion"><span title="Ver facturacion" alt="Ver facturacion" class="glyphicon glyphicon-search"></span></a></td>
        </tr>
    }
</table>
<form class="form-horizontal" name="listForm" method="get">
    <input type="hidden" name="idCaso" value="@ViewBag.idCaso" />
    <div class="form-group">
        <div class="col-md-3 col-sm-6">
            @if (!ViewBag.esCliente){
                <button type="button" onclick="javascript:AddCostDocument(document.listForm)" class="btn btn-large btn-primary">Añadir</button>
            }
            <button type="button" class="btn btn-large" onclick="javascript:history.back();">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Atras":"Back")</button>
        </div>
    </div>
</form>
